<include file="Index/header" />
<div class="container">
	<nav class="navbar navbar-default" role="navigation">
		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
			<ul class="nav navbar-nav">
				<li>
					<a href="?m=admin&c=goods&a=index" class="glyphicon glyphicon-arrow-right">返 回</a>
				</li>
			</ul>
			<form class="navbar-form navbar-right" action="?m=admin&c=goods&a=query" method="post" role="search">
				<div class="form-group">
					<input type="text" class="form-control" placeholder="商品名称" name="goods_name" id="name" />
				</div> <button type="submit" class="btn btn-default">搜索</button>
			</form>
		</div>
	</nav>
	<!-- 商品 -->
	<div class="row">
		<foreach name="goodsInfo" item="value">
			<div class="thumbnail col-md-3">
				<a href="?m=Home&c=goods&a=item&gi={$value[goods_id]}"><img alt="300x200"
						src="__PUBLIC__/images/goods/{$value['pic_url']}" /></a>
				<div class="caption">
					<h3>
						{$value['goods_name']}
					</h3>
					<p style="height: 40px; overflow: hidden;">
						{$value['goods_descript']}
					</p>
					<p class="place">￥{$value['goods_price']}</p>
					<p>
						<a class="btn btn-primary" href="?m=Home&c=goods&a=item&gi={$value[goods_id]}">查看</a>
					</p>
					<p>
						<a class="btn btn-primary" href="?m=admin&c=goods&a=update&gi={$value[goods_id]}">编辑</a>
						<a class="btn btn-primary" href="?m=admin&c=goods&a=addImg&gi={$value[goods_id]}">添加图片</a>
						<a class="btn btn-primary" href="?m=admin&c=dump&a=add&gi={$value[goods_id]}"
							onclick="return dump()">回收</a>
					</p>
				</div>
			</div>
		</foreach>
	</div>
</div>
<script type="text/javascript">
	function query() {
		var name = document.getElementById('name').value;
		if (name == '') {
			alert("查询商品名称不能为空!");
			return false;
		}
		return true;
	}

	function dump() {
		if (window.confirm("是否要将该商品放入回收站")) {
			return true;
		}
		return false;
	}

</script>
<include file="Index/footer" />